Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 6 - Configuration Management / Configuration Management Reference
Constants and Data Types


The Port Structure

Open Transport uses a port structure to describe a port's characteristics, such as its port name, its child ports, whether it is active or disabled, whether it is private or sharable, and the kind of framing it can use.

The port structure is defined by the OTPortRecord data type.

struct OTPortRecord {
   OTPortRef   fRef;
   UInt32      fPortFlags;
   UInt32      fInfoFlags;
   UInt32      fCapabilities;
   size_t      fNumChildPorts;
   OTPortRef*  fChildPorts;
   char        fPortName[kMaxProviderNameSize];
   char        fModuleName[kMaxModuleNameSize];
   char        fSlotID[kMaxSlotIDSize];
   char        fResourceInfo[kMaxResourceInfoSize];
   char        fReserved[164];
};
Field Description
fRef
The port reference; a 32-bit value encoding the port's device type, bus type, slot number, and multiport identifier. For more details, see the next section, "The Port Reference."
fPortFlags
Flags describing the port's status. Only 1 bit can be set at a time. If no bits are set, the port is currently inactive--that is, it is not in use at this time.
Flag ValueDescription
kOTPortIsActive0x00000001The port is in use.
kOTPortIsDisabled0x00000002The port may or may not be in use, but no other client can use it.
kOTPortIsUnavailable0x00000004The port is not available for use.
fInfoFlags
Flags providing additional information about the port.
Flag ValueDescription
kOTPortIsDLPI0x00000001The port is a DLPI Streams module.
kOTPortIsTPI0x00000002The port is a TPI Streams module.
kOTPortCanYield0x00000004The port can yield when requested.
kOTPortIsSystemRegistered0x00004000The port is registered in the system registry.
kOTPortIsPrivate0x00008000The port is a private port.
kOTPortIsAlias0x80000000The port is an alias for
another port.
fCapabilities
Flags indicating the type of framing capability that a port has. If the port can handle only one type of framing, this field is 0. For example, Ethernet framing uses the following values:
FlagValueDescription
kOTFramingEthernet0x01The port can use standard Ethernet framing.
kOTFramingEthernetIPX0x02The port can use IPX
Ethernet framing.
kOTFraming80230x04The port can use 802.3 Ethernet framing.
kOTFraming80220x08The port can use 802.2 Ethernet framing.
fNumChildPorts
The number of child ports associated with this port.
fChildPorts
An array of the port references for the child ports associated with this port.
fPortName
A unique name for this port. The port name is a zero-
terminated string that can have a maximum length as indicated by the constant kMaxProviderNameSize.
fModuleName
The name of the actual Streams module that implements the driver for this port. Open Transport uses this name internally; you do not use this name.
fSlotID
An 8-byte identifier for a port's slot that contains a 7-byte character string plus a zero for termination. This identifier is typically available for PCI cards.
fResourceInfo
A zero-terminated string that describes a shared library that can handle configuration information for the device. This field contains an identifier that allows Open Transport to access auxiliary information about your driver (Open Transport creates shared library IDs from this string to be able to find these extra shared libraries). This string should either be unique to your driver or should be set to a NULL string.
fReserved
Reserved.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996